﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="Project.UI.ProductList" %>

<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script src="Scripts/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#gvProduct img").load(function () {
            var w = $(this).width();
            var h = $(this).height();
            $(this).width(w / 4);
            $(this).height(h / 4);
        });
    });   
</script>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:DataList ID="dlProduct" runat="server" RepeatColumns="4" RepeatDirection="Horizontal">
            <ItemTemplate>
                <a href='ProducttDetail.aspx?pid=<%#Eval("Product_ID") %>'><asp:Image ID="Image2" runat="server" Height="163px" ImageUrl='<%# Eval("Represent_Pic1") %>' Width="211px" /></a>
                <br />
                <asp:Label ID="lblProductname" runat="server" Text='<%# Eval("Product_Name") %>'></asp:Label>
                <br />
                <asp:Label ID="Label2" runat="server" Text="Giá: "></asp:Label>
                <asp:Label ID="lblUnit_Price" runat="server" Text='<%# Eval("Unit_Price") %>'></asp:Label>
                <br />
                <a href='OrderProduct.aspx?pid=<%#Eval("Product_ID") %>'><asp:Image ID="Image1" runat="server" Height="40px" Width="46px" ImageUrl="ProductPicture/cart.jpg" /></a>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <div style="margin-left: 200px">
        <cc1:CollectionPager ID="clPager" runat="server" BackText="« Trước"
            FirstText="Đầu" LabelText="Trang:" LastText="Cuối" NextText="Sau »"
            ResultsFormat="Hiển thị {0}-{1} (of {2})">
        </cc1:CollectionPager>
    </div>
    </form>
</body>
</html>
